package com.gmu.mapper;

import com.gmu.pojo.TblUnits;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gmu.pojo.vo.units.SchoolVo;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 单位表 Mapper 接口
 * </p>
 *
 * @author testjava
 * @since 2022-07-24
 */
public interface TblUnitsMapper extends BaseMapper<TblUnits> {

    /**
     * 获取某单位的所有叶子节点
     */
    List<TblUnits> selectUnitsChildren(Integer unitsId);

    List<TblUnits> getAllUnitsByRoleId(Integer roleId);

    List<TblUnits> getUnitsSchoolByParentId(@Param("parentId") Integer parentId);

    List<TblUnits> getAllUnits(Integer parentId);

    void addUnits(TblUnits tblUnits);

    void deleteUnits(TblUnits tblUnits);

    List<TblUnits> getAllUnitsByIsSample(Integer sampleStatus);

    //查找是否存在最顶级单位
    TblUnits getTopUnits(String unitName);
    //查找是否存在其他单位
    TblUnits getOtherUnits(String unitName,Integer parentId);
}
